package com.hualan.sfzyproject.mapper;


import com.hualan.sfzyproject.domain.ChatMessage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface ChatMessageMapper {
    
    // 插入消息
    int insert(ChatMessage message);
    
    // 根据发送者或接收者ID获取消息列表
    List<ChatMessage> findBySenderIdOrReceiverId(@Param("senderId") String senderId, 
                                                @Param("receiverId") String receiverId);
    
    // 获取教师的最新消息列表
    List<ChatMessage> findLatestMessagesByTeacherId(@Param("teacherId") String teacherId);
}